#!/bin/bash

foreachd(){
    for file in $1/*
	do
		if test -f $file
		then
			echo "dos to unix:$file"
			dos2unix $file
		fi
		if test -d $file
		then
		   echo "foreach dir:$file"
		   foreachd $file
		fi
	done
}

if [[ "x$1" == 'x' ]]
then
	foreachd "."
else
	foreachd "$1"
fi
